package cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.mapper;

import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.entity.FundArrival;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FundArrivalMapper {
    @Insert("INSERT INTO fund_arrival (name, arrival_time, arrival_amount, status) " +
            "VALUES (#{name}, #{arrivalTime}, #{arrivalAmount}, #{status})")
    boolean insert(FundArrival fundArrival);

    @Delete("DELETE FROM fund_arrival WHERE id = #{id}")
    boolean deleteById(int id);

    @Update("UPDATE fund_arrival SET name = #{name}, arrival_time = #{arrivalTime}, " +
            "arrival_amount = #{arrivalAmount}, status = #{status} WHERE id = #{id}")
    boolean update(FundArrival fundArrival);

    @Select("SELECT * FROM fund_arrival WHERE id = #{id}")
    FundArrival selectById(int id);

    @Select("SELECT * FROM fund_arrival")
    List<FundArrival> selectAll();
}